Optimal. Leaf size=49 \[ -a^3 x+\frac {i a^3 \log (\cos (c+d x))}{d}-\frac {2 i a^4}{d (a-i a \tan (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 24, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.083, Rules used = {3568, 45}
\begin {gather*} -\frac {2 i a^4}{d (a-i a \tan (c+d x))}+\frac {i a^3 \log (\cos (c+d x))}{d}-a^3 x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3568
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a+i a \tan (c+d x))^3 \, dx &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \frac {a+x}{(a-x)^2} \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-\frac {\left (i a^3\right ) \text {Subst}\left (\int \left (\frac {2 a}{(a-x)^2}+\frac {1}{-a+x}\right ) \, dx,x,i a \tan (c+d x)\right )}{d}\\ &=-a^3 x+\frac {i a^3 \log (\cos (c+d x))}{d}-\frac {2 i a^4}{d (a-i a \tan (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(99\) vs. \(2(49)=98\).
time = 0.28, size = 99, normalized size = 2.02 \begin {gather*} -\frac {a^3 \left (\cos (c+d x) \left (2 i+2 d x-i \log \left (\cos ^2(c+d x)\right )\right )+\left (-2-2 i d x-\log \left (\cos ^2(c+d x)\right )\right ) \sin (c+d x)\right ) (\cos (c+4 d x)+i \sin (c+4 d x))}{2 d (\cos (d x)+i \sin (d x))^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 98 vs. \(2 (46 ) = 92\).
time = 0.21, size = 99, normalized size = 2.02
method | result | size |
risch | \(-\frac {i a^{3} {\mathrm e}^{2 i \left (d x +c \right )}}{d}+\frac {2 a^{3} c}{d}+\frac {i a^{3} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) | \(50\) |
derivativedivides | \(\frac {-i a^{3} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-3 a^{3} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {3 i a^{3} \left (\cos ^{2}\left (d x +c \right )\right )}{2}+a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(99\) |
default | \(\frac {-i a^{3} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right )}{2}-\ln \left (\cos \left (d x +c \right )\right )\right )-3 a^{3} \left (-\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )-\frac {3 i a^{3} \left (\cos ^{2}\left (d x +c \right )\right )}{2}+a^{3} \left (\frac {\sin \left (d x +c \right ) \cos \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) | \(99\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 62, normalized size = 1.27 \begin {gather*} -\frac {2 \, {\left (d x + c\right )} a^{3} + i \, a^{3} \log \left (\tan \left (d x + c\right )^{2} + 1\right ) - \frac {4 \, {\left (a^{3} \tan \left (d x + c\right ) - i \, a^{3}\right )}}{\tan \left (d x + c\right )^{2} + 1}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.35, size = 36, normalized size = 0.73 \begin {gather*} \frac {-i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.20, size = 61, normalized size = 1.24 \begin {gather*} \frac {i a^{3} \log {\left (e^{2 i d x} + e^{- 2 i c} \right )}}{d} + \begin {cases} - \frac {i a^{3} e^{2 i c} e^{2 i d x}}{d} & \text {for}\: d \neq 0 \\2 a^{3} x e^{2 i c} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.64, size = 36, normalized size = 0.73 \begin {gather*} \frac {-i \, a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + i \, a^{3} \log \left (e^{\left (2 i \, d x + 2 i \, c\right )} + 1\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.29, size = 39, normalized size = 0.80 \begin {gather*} \frac {2\,a^3}{d\,\left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )}-\frac {a^3\,\ln \left (\mathrm {tan}\left (c+d\,x\right )+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________